libelf: improve PVH elfnote parsing
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 28 May 2021 07:14:44 +0000 (09:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 28 May 2021 07:14:44 +0000 (09:14 +0200)
commit632cbaf1243e4b867caf321cfef81517f5cc27ad
treee146dd3bd75c8c6f6b7a1953b8c78c91f9a65ec2
parentdec25a2cd1c8089a39900ed978c8e7ab62d2a4d4
libelf: improve PVH elfnote parsing

Pass an hvm boolean parameter to the elf note checking routines, so that
better checking can be done in case libelf is dealing with an hvm
container.

elf_xen_note_check shouldn't return early unless PHYS32_ENTRY is set
and the container is of type HVM, or else the loader and version
checks would be avoided for kernels intended to be booted as PV but
that also have PHYS32_ENTRY set.

Adjust elf_xen_addr_calc_check so that the virtual addresses are
actually physical ones (by setting virt_base and elf_paddr_offset to
zero) when the container is of type HVM, as that container is always
started with paging disabled.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/libelf/libelf-dominfo.c